home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / iritsm3s.zip / PRIORQUE.H < prev    next >
C/C++ Source or Header  |  1992-01-20  |  1KB  |  29 lines

  1. /*****************************************************************************
  2. * Definitions, visible to others, of Priority Queue module:             *
  3. *****************************************************************************/
  4.  
  5. #ifndef PRIOR_Q_GH
  6. #define PRIOR_Q_GH
  7.  
  8. typedef struct PriorQue {
  9.     struct PriorQue *Right, *Left;    /* Pointers to two sons of this node. */
  10.     VoidPtr Data;                  /* Pointers to the data itself. */
  11. } PriorQue;
  12.  
  13. typedef int (*PQCompFuncType)(VoidPtr, VoidPtr);      /* Comparison function. */
  14.  
  15. /* And global function prototypes: */
  16. void PQInit(PriorQue **PQ);
  17. int PQEmpty(PriorQue *PQ);
  18. void PQCompFunc(PQCompFuncType NewCompFunc);
  19. VoidPtr PQFirst(PriorQue **PQ, int Delete);
  20. VoidPtr PQInsert(PriorQue **PQ, VoidPtr NewItem);
  21. VoidPtr PQDelete(PriorQue **PQ, VoidPtr NewItem);
  22. VoidPtr PQFind(PriorQue *PQ, VoidPtr OldItem);
  23. VoidPtr PQNext(PriorQue *PQ, VoidPtr CmpItem, VoidPtr BiggerThan);
  24. void PQPrint(PriorQue *PQ, void (*PrintFunc)());
  25. void PQFree(PriorQue *PQ, int FreeItems);
  26. void PQFreeFunc(PriorQue *PQ, void (*FreeFunc)());
  27.  
  28. #endif /* PRIOR_Q_GH */
  29.